package com.ruoyi.system.domain;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Transient;

import java.util.Date;

/**
 * sim卡管理对象 t_sim_card
 * 
 * @author wp
 * @date 2023-08-10
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Accessors(chain = true)
@ToString
@TableName(value = "t_sim_card", excludeProperty = {"createBy", "createTime", "remark"})
public class SimCard extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 唯一主键 */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /** 设备id */
    private Long equipmentId;

    /** msisdn */
    private String msisdn;

    @ApiModelProperty(value = "iccid")
    @Excel(name = "SIM卡号", sort = 1)
    private String iccid;

    /** imsi */
    private String imsi;

    /** imsi2 */
    private String imsi2;

    @Excel(name = "SIM卡商", sort = 2)
    private String carrier;

    /** 短信端口号 */
    @JSONField(name = "sp_code")
    private String spCode;

    /** 套餐大小 */
    @JSONField(name = "data_plan")
    private String dataPlan;

    /** 计费结束日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "到期时间", dateFormat = "yyyy-MM-dd", sort = 4)
    @JSONField(name = "expiry_date")
    private Date expiryDate;

    /** 当月流量 */
    @JSONField(name = "data_usage")
    private String dataUsage;

    @ApiModelProperty(value = "SIM卡状态")
    @Excel(name = "SIM卡状态", dictType = "accountStatus", sort = 8)
    @JSONField(name = "account_status")
    private String accountStatus;

    /** 测试期起始日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "test_valid_date")
    private Date testValidDate;

    /** 沉默期起始日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "silent_valid_date")
    private Date silentValidDate;

    /** 出库日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "outbound_date")
    private Date outboundDate;

    /** 激活日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "active_date")
    @Excel(name = "开卡时间", dateFormat = "yyyy-MM-dd", sort = 3)
    private Date activeDate;

    /** 是否支持短信 */
    @JSONField(name = "support_sms")
    private Long supportSms;

    @Excel(name = "剩余流量（M）", sort = 6)
    @JSONField(name = "data_balance")
    private String dataBalance;

    /** 测试期已用流量 */
    @JSONField(name = "test_used_data_usage")
    private String testUsedDataUsage;

    /** sim卡类型 */
    @JSONField(name = "sim_type")
    private String simType;

    /** 是否是累计卡 */
    @JSONField(name = "accumulated")
    private Long accumulated;

    /** 计费组code */
    private String code;

    @Excel(name = "SIM卡总流量（M）", sort = 5)
    @JSONField(name = "data_traffic_amount")
    private String dataTrafficAmount;

    /** 计费起始日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "valid_date")
    private Date validDate;

    @Excel(name = "超出流量（M）", sort = 7)
    @JSONField(name = "out_data_usage")
    private String outDataUsage;

    @TableField(exist = false)
    private String companyId;

    @ApiModelProperty(value = "设备名称")
    @Excel(name = "设备名称", sort = 10)
    @TableField(exist = false)
    private String numberPlate;

    @ApiModelProperty(value = "设备号")
    @Excel(name = "设备号", sort = 9)
    @TableField(exist = false)
    private String deviceId;

    @ApiModelProperty(value = "SIM卡到期状态 （1已到期，0未到期）")
    @TableField(exist = false)
    @JsonIgnore
    private Integer isOutDate;
    @ApiModelProperty(value = "是否超出用量 （1已超出，0未超出）")
    @TableField(exist = false)
    @JsonIgnore
    private Integer isOutDataUsage;
    //系统流量超限制阈值
    @TableField(exist = false)
    @JsonIgnore
    private Double outDataUsageValue;

}
